#include "term.h"
using namespace std;

regex_base* term::copy() const
{
     term* p = new term(*this);
     return p;
}

match_result term::match(const string& s) const
{
	if(s.length()<m.length())
	{
		return match_result(0,0);
	}
	else
	{
		if(string(s.begin(),s.begin()+m.length())==m)
		{
			return match_result(true,m.length());
		}
		else
		{
			return match_result(0,0);
		}
	}
}
